<?php if (count($rellist) > 0) {
if ($this->auth->has_rights_to("edit", "bch", $rellist[0]['bch1']))
	$hasrights = true; ?>
<table id="relation-list">
	<thead>
		<tr>
      <th>Type</th>
      <th>Branch</th>
      <th>Version</th>
    </tr>
  </thead>
  <tbody>
    <?php $count=1; foreach($rellist as $rel):?>
    <tr id="relation-<?=$count;?>">
      <td><?=$rel['rel_type']?></td>
      <td><?=$rel['uf_bch2']?></td>
      <td><?=$rel['optdata']?></td>
      <? if ($hasrights): ?>
      <td><img class="action" title="Delete the relation" style="cursor: pointer;" onclick="deleteRelation(<?=$count.','.$rel['bch1'].',\''.$rel['rel_type'].'\','.$rel['bch2'];?>);" alt="Delete Relation" src="<?= base_url();?>img/delete.png" /></td>
      <?php endif; $count++; ?>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>
<?php } //(count($rellist) > 0) ?>